package liming.ai.tool;

import liming.tool.json.ToJson;
import liming.tool.json.annotation.JsonMark;

import java.util.Arrays;

public class InvokeInfo implements ToJson {
    @JsonMark
    String toolName;
    @JsonMark
    String methodName;
    @JsonMark
    Object[] args;
    @JsonMark
    boolean success;
    @JsonMark
    Object value;
    @JsonMark
    String message;
    public InvokeInfo() {}

    /**
     * 创建一个InvokeInfo对象
     * @param toolName 工具名称
     * @param methodName 方法名称
     * @param args 参数
     * @param success 调用是否成功
     * @param value 返回值
     * @param message 运行信息
     */
    public InvokeInfo(String toolName, String methodName, Object[] args, boolean success, Object value, String message) {
        this.toolName = toolName;
        this.methodName = methodName;
        this.args = args;
        this.success = success;
        this.value = value;
        this.message = message;
    }

    public String getToolName() {
        return toolName;
    }

    public void setToolName(String toolName) {
        this.toolName = toolName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "InvokeInfo{" +
                "toolName='" + toolName + '\'' +
                ", methodName='" + methodName + '\'' +
                ", args=" + Arrays.toString(args) +
                ", success=" + success +
                ", value=" + value +
                ", message='" + message + '\'' +
                '}';
    }
}
